#include<iostream>
#include"List.h"

void list_test1()
{
	yyc::List<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_back(5);

	auto it = lt1.begin();
	while ( it != lt1.end())
	{
		cout << *it << ' ';
		++it;
	}
	cout << endl;
	lt1.push_front(10);
	lt1.push_front(20);
	lt1.push_front(30);
	lt1.push_front(40);

	for (auto a : lt1)
	{
		cout << a << ' ';
	}
	cout << endl;

	lt1.pop_back();
	lt1.pop_back();
	lt1.pop_back();
	lt1.pop_front();
	lt1.pop_front();
	lt1.pop_front();
	for (auto a : lt1)
	{
		cout << a << ' ';
	}
	cout << endl;

	//yyc::List<int> lt2 = { 1,2,3,4,5,6,7,8,9 };
	yyc::List<int> lt2 = lt1;
	
	for (auto a : lt2)
	{
		cout << a << ' ';
	}
	cout << endl;
	lt2.clear();
	for (auto a : lt2)
	{
		cout << a << ' ';
	}
	cout << endl;
}


int main()
{
	list_test1();
	return 0;
}